﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="dealer_detail.aspx.cs" Inherits="admin_vico_dealer_detail" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>经销商信息 </title>
    <link href="../css/default.css" rel="stylesheet" type="text/css" />

    <script src="../js/jUtility.js" type="text/javascript"></script>

    <script type="text/javascript" src="../common/calendar.js"></script>

    <script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
   
</head>
<body>
    <table width="100%" height="500" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
        <tr>
            <td height="414" align="left" valign="top" class="rightbg">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td height="2" bgcolor="#A49B81">
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" background="../images/position_bg.gif" bgcolor="#EEF6FE" class="subnav"
                                        style="background-repeat: repeat-y; background-position: left; padding-left: 6px;
                                        padding-top: 3px;">
                                        <asp:Label ID="headers" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td height="1" bgcolor="#B0C9E8">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td height="16">
                        </td>
                    </tr>
                    <tr>
                        <td>
                        &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td align="left" valign="top" style="padding-left: 10px;">
                            <form id="form1" method="post" runat="server">
                            <asp:HiddenField ID="did" runat="server" />
                            <asp:HiddenField ID="ordernum" runat="server" />
                            <table width="95%" height="728" border="1" align="center" cellpadding="0" cellspacing="0"
                                bordercolorlight="#2583BC" bordercolordark="#ffffff">
                                <tr>
                                    <td width="100%" height="641" valign="top">
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <th align="left" width="80%">
                                                    <asp:Label ID="infoname" runat="server"></asp:Label>
                                                </th>
                                                <th align="left">
                                                    <a href="dealer_list.aspx?layerid=<%=Layerid %>">
                                                        返回 </a>
                                                </th>
                                            </tr>
                                        </table>
                                        <br>
                                        <table width="100%" border="0">
                                            <tr>
                                                <td width="7%" align="right">
                                                    <font color="#FF0000">* </font>名称：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <asp:TextBox ID="dealername" runat="server" MaxLength="100" size="50" />
                                                </td>
                                            </tr>
                                            <tr id="Tr_subtitle" runat="server" >
                                                <td width="7%" align="right">
                                                    <font color="#FF0000"></font>代码：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <asp:TextBox ID="dealercode" runat="server" MaxLength="100" size="50" />
                                                </td>
                                            </tr>
                                            <tr id="Tr_subtitle2" runat="server" >
                                                <td width="7%" align="right">
                                                    <font color="#FF0000">*</font>省：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <select id="province" name="province" onchange="setCity2(this.value,'city');">
                                                        <option value="">省份</option>
                                                        <%=pstr%>
                                                    </select> 
                                                </td>
                                            </tr>
                                            <tr>
                                                <td  align="right">
                                                   <font color="#FF0000">*</font> 市：
                                                </td>
                                                <td width="2%">
                                                    &nbsp;
                                                </td>
                                                <td width="75%">
                                                    <select id="city" name="city" ><option value="">城市</option></select>
                                                </td>
                                            </tr>
                                            
                                        </table>
                                        
                                        
                                        <table width="100%" border="0">
                                            <tr>
                                                <td height="54" colspan="3" align="center">
                                                    <asp:Button Text="保存" ID="sub1" OnClientClick="return subfunc(1)" runat="server"
                                                        OnClick="Sub_click" />
                                                    
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            </form>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <iframe id="wait2" name="wait2" style="display: none" width="100%" height="100%"
        src="../images/wait.gif" frameborder='0' align='middle' bgcolor='#FFFFFF'></iframe>

    <script type="text/javascript"> 

		var o;
		
		function subfunc(flag) {
			if(!isFilled(form1.dealername)){
				return warning('dealername','名称不能为空!');
			}
			if(form1.province.value == ""){
			    alert("请选择省份");
			    return false;
			}
			if(form1.city.value == ""){
			    alert("请选择城市");
			    return false;
			}
			
			return true;	
		}
		function warning(FieldName,WarningString){
				alert(WarningString);
				eval("form1." + FieldName + ".focus();");
				return(false);
}
		 <%=cstr%>
		function setCity2(pname, cid) {
		    document.getElementById(cid).options.length = 0;
		    var option = document.createElement("OPTION");
		    option.text = "城市";
		    option.value = "";
		    document.getElementById(cid).options.add(option);
		    var pcd = citys[pname];
		    for (var i = 0; i < pcd.length; i++) {
		        var city = pcd[i];
		        //if (city[0] == pname) {
		        //if (exitis.indexOf(city[1] + ",") < 0) {
		        option = document.createElement("OPTION");
		        option.text = city[1];
		        option.value = city[0];
		        <%if(cid!="" && cid!="0"){ %>
		        option.selected = true;
		        <%} %>
		        document.getElementById(cid).options.add(option);
		        //exitis += city[1] + ",";
		        // }
		        // }
		    }
		}
		<%if(pid!="" && pid!="0"){ %>
		form1.province.value = '<%=pid %>';
		setCity2('<%=pid %>','city');
		
		<%} %>
    </script>

</body>
</html>
